import request from "@/utils/request";

// 获取采购订单列表
export function getOrderListApi(query, data) {
  return request({
    url: "/system/orderInfo/list",
    method: "post",
    params: query,
    data,
  });
}

// 新增采购订单
export function addOrederApi(data) {
  return request({
    url: "/system/orderInfo/add",
    method: "post",
    data,
  });
}

// 编辑采购订单
export function editOrederApi(data) {
  return request({
    url: "/system/orderInfo/edit",
    method: "post",
    data,
  });
}

// 采购订单审核撤销
export function checkErpOrderApi(data) {
  return request({
    url: "/system/orderInfo/checkErpOrder",
    method: "post",
    data,
  });
}

//撤销
export function saveCancel(data) {
  return request({
    url: "/system/orderInfo/saveCancel",
    method: "post",
    data,
  });
}

// 获取采购订单详情
export function getOrderDetailApi(purchaseOrderId) {
  return request({
    url: `/system/orderInfo/getInfo`,
    method: "get",
    params: { purchaseOrderId },
  });
}

// 删除询比价
export function deleteOrderId(purchaseOrderId) {
  return request({
    url: `/system/orderInfo/del`,
    method: "get",
    params: { purchaseOrderId },
  });
}

// 审核
export function checkOrderApi(data) {
  return request({
    url: "/system/orderInfo/checkErpOrder",
    method: "post",
    data,
  });
}


// 审核进度
export function selectAuditList(deliveryApplyId) {
  return request({
    url: `/system/orderInfo/selectAuditList`,
    method: "get",
    params: { deliveryApplyId },
  });
}